package 设计模式.a_简单工厂;

import java.util.function.Supplier;

/**
 * @author caihe
 * @date 2023/3/6 11:11
 */
public enum CoinTypeEnum {
    
    COPPER(CopperCoin::new),
    GOLD(GoldCoin::new)
    ;
    
    private final Supplier<Coin> coin;

    CoinTypeEnum(Supplier<Coin> coin) {
        this.coin = coin;
    }

    public Supplier<Coin> getCoin() {
        return coin;
    }
}
